package com.yeeiee.source;

import com.yeeiee.catalog.ClinkCatalog;
import com.yeeiee.config.MysqlSourceConfig;
import lombok.val;
import org.apache.flink.configuration.ConfigOption;

import java.util.HashSet;
import java.util.Set;


public abstract class AbstractJdbcSource implements ClinkSource {

    @Override
    public void setConnector(ClinkCatalog clinkCatalog) {
        clinkCatalog.setConnector("jdbc");
    }

    @Override
    public Set<ConfigOption<?>> requiredOptions() {
        val required = new HashSet<ConfigOption<?>>();
        required.add(MysqlSourceConfig.catalog);
        required.add(MysqlSourceConfig.tablePath);
        return required;
    }
}
